package com.banana.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * @author layman
 * @description: 自定义ribbon的负载均衡配置类
 */
@Configuration
public class MyRule {
    @Bean
    public IRule myRule(){
        //切换为随机模式
        return new RandomRule();
    }
}
